package cn.softgame.jserver.connector.data;

import java.io.OutputStream;

import cn.softgame.jserver.queue.MessageQueue;

/**
 * 一个访问者具体子类
 * @author xuquan
 * 日期:2013-5-28
 */
public class QueueAddWorker implements QueueWorker {
	private MessageQueue messageQueue=null;
	
	public QueueAddWorker(MessageQueue messageQueue) {
		this.messageQueue=messageQueue;
	}

	@Override
	public void run(int msgType, Linkable object) throws Exception {
		// 获得元素转换后的outputStream对象
		OutputStream os = object.getOutputStream();
		if(msgType==REQUEST){
			messageQueue.pushRequest(os);
		}else if(msgType==RESPONSE){
			messageQueue.pushResponse(os);
		}
	}

}
